<?php /* SVN: $Id: admin_index-updates.ctp 2860 2010-08-27 06:14:20Z boopathi_026ac09 $ */ ?>
<div class="projects index js-response">
<h2><?php echo __l('Project Updates - Under Development');?></h2>
<?php echo $this->Form->create('Project', array('type' => 'get', 'class' => 'normal filter-form clearfix', 'action'=>'index')); ?>
	<div class="filter-section clearfix">
		<div>
			<?php echo $this->Form->input('filter_id',array('empty' => __l('Please Select'))); ?>
            <?php echo $this->Form->input('q', array('label' => 'Keyword')); ?>
        </div>
		<div>
			<?php echo $this->Form->submit(__l('Search'));?>
		</div>
	</div>
	<?php echo $this->Form->end(); ?>
<?php
 echo $this->Form->end();
 echo $this->Form->create('Project' , array('class' => 'normal clearfix','action' => 'update')); ?>
<?php echo $this->Form->input('r', array('type' => 'hidden', 'value' => $this->request->url)); ?>
<?php echo $this->element('paging_counter');?>
<table class="list">
    <tr>
        <th class="actions"><?php echo __l('Actions');?></th>
        <th><div class="js-pagination"><?php echo $this->Paginator->sort(__l('Project'), 'name');?></div></th>
        <th><div class="js-pagination"><?php echo $this->Paginator->sort(__l('User'), 'User.username');?></div></th>        
        <th><div class="js-pagination"><?php echo __l('Latest Update');?></div></th>
		<th><div class="js-pagination"><?php echo $this->Paginator->sort(__l('Updated On'), 'created');?></div></th>
    </tr>
<?php
if (!empty($projects)):

$i = 0;
foreach ($projects as $project):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
	if($project['Project']['is_active']):
		$status_class = 'js-checkbox-active';
	else:
		$status_class = 'js-checkbox-inactive';
	endif;
?>
	<tr<?php echo $class;?>>
		<td class="actions dl">
        <span><?php echo $this->Html->link(__l('Add Updates'), array('controller'=>'project_updates','action' => 'add', $project['Project']['id']), array('class' =>'add', 'title' => __l('Add Updates')));?></span></td>
		<td><?php echo $this->Html->link($this->Html->cText($project['Project']['name'],false),array('controller'=>'projects','action'=>'view',$project['Project']['slug'],'admin'=>false), array('escape' => false));?></td>
		<td><?php echo $this->Html->link($this->Html->cText($project['User']['username']), array('controller'=> 'users', 'action'=>'view', $project['User']['username'], 'admin' => false), array('escape' => false));?></td>		
		<td><?php
        if(!empty($project['ProjectUpdate'][0]['update'])):
            echo $this->Html->cText($project['ProjectUpdate'][0]['update']);
          endif;
        ?>
            
        </td>
		<td><?php echo $this->Html->cDateTimeHighlight($project['Project']['created']);?></td>
	</tr>
<?php
    endforeach;
else:
?>
	<tr>
		<td colspan="22" class="notice"><?php echo __l('No Projects available');?></td>
	</tr>
<?php
endif;
?>
</table>

<?php if (!empty($projects)) {?>
    <div>
        <?php echo $this->element('paging_links'); ?>
    </div>
    <div class="hide">
	    <?php echo $this->Form->submit('Submit'); ?>
	    <?php echo $this->Form->end(); ?>
    </div>
<?php }?>
</div>

